﻿@model MvcCms.Store.Web.ViewModels.DefaultViewModel
           
<link href="@Url.Content("~/Areas/MvcCmsStore/Scripts/jquery-ui-1.8.16.custom/css/ui-lightness/jquery-ui-1.8.16.custom.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Areas/MvcCmsStore/Scripts/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>

<h3>View Daily Orders</h3>

<div>
    @Html.TextBox("dateToGetOrdersFor", DateTime.Now.ToShortDateString(), new { @class = "datePicker" })    
    <a href="javascript:void(0);" onclick="ShowOrders()">Show Orders</a>
</div>
<div id="orders-container">
</div>
<script type="text/javascript">
$(document).ready(function () {
    $(".datePicker").datepicker();
});
function ShowOrders() {
    var jdata = { 
        dateToGetOrdersFor: $("#dateToGetOrdersFor").val(),
        portalId: @Model._Portal.PortalID
    };

    $.ajax({
        url: "/MvcCmsStoreAjax/storeManager/StoreOrders",
        type: "POST",
        dataType: "html",
        data: jdata,
        success: function (html) {
            $("#orders-container").html(html);
        }
    })    
}
</script>
